﻿using System;
using System.Collections.Generic;
using System.Text;

namespace NFinal.Config
{
    public class GlobalServices
    {
        public GlobalServices()
        {
            this.serializable = NFinal.Config.Configration.serviceCollection.GetService<NFinal.Serialize.ISerializable>();
            this.cache = NFinal.Config.Configration.serviceCollection.GetService<NFinal.Cache.ICache<string>,
                    //ICache初始化时的参数类型
                    NFinal.Serialize.ISerializable>(this.serializable);
            this.sessionConstructor = NFinal.Config.Configration.serviceCollection.GetServiceConstructor<NFinal.Http.ISession, string,NFinal.Cache.ICache<string>, NFinal.Http.ISession>();
            this.jsonSerialize = NFinal.Config.Configration.serviceCollection.GetService<NFinal.Json.IJsonSerialize>();
        }
        public NFinal.Cache.ICache<string> cache { get;  }
        public NFinal.Serialize.ISerializable serializable { get; set; }
        public Func<string,NFinal.Cache.ICache<string>,NFinal.Http.ISession> sessionConstructor { get; set; }
        public NFinal.Json.IJsonSerialize jsonSerialize {get;set;}
    }
}
